home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 April / 1989-04.d64 / alarm clock (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  41 lines

  1. 10 rem digital alarm clock
  2. 15 print"[147]":poke53281,6:poke53280,14:poke646,14
  3. 20 fori=49152to49283:reada:x=x+a:pokei,a:nexti:rem poke alarm ml routine
  4. 30 ifx<>15756thenprint"data statement error.":stop
  5. 40 a$="clock":c=49288:gosub280:a$="alarm":c=49284:gosub280:rem get times
  6. 50 sys49152:end:rem set alarm
  7. 60 data 169,42,141,24,3,169
  8. 70 data 192,141,25,3,173,15
  9. 80 data 221,9,128,141,15,221
  10. 90 data 160,0,32,102,192,173
  11. 100 data 15,221,41,127,141,15
  12. 110 data 221,160,4,32,102,192
  13. 120 data 169,132,141,13,221,96
  14. 130 data 173,13,221,41,4,240
  15. 140 data 50,169,4,141,13,221
  16. 150 data 32,115,192,169,13,141
  17. 160 data 24,212,169,0,141,5
  18. 170 data 212,169,240,141,6,212
  19. 180 data 169,4,141,1,212,169
  20. 190 data 33,141,4,212,32,159
  21. 200 data 255,165,198,240,249,32
  22. 210 data 115,192,32,126,192,169
  23. 220 data 0,133,198,76,71,254
  24. 230 data 162,3,185,132,192,157
  25. 240 data 8,221,200,202,16,246
  26. 250 data 96,169,0,160,24,153
  27. 260 data 0,212,136,16,250,96
  28. 270 data 120,32,138,255,88,96
  29. 280 print"[147]for the "a$" time:"
  30. 290 print:input"what is the hour";h$:h=val(h$):ifh<0orh>12then290
  31. 300 f=0:input"am or pm";f$:ifleft$(f$,1)="p"thenf=128
  32. 310 hn=0:ifh>9thenhn=16
  33. 320 hh=val(right$(h$,1)):h=f+hn+hh:pokec+0,h
  34. 330 input"what is the minute";m$:m=val(m$):ifm<0orm>59then330
  35. 340 mn=0:ifm>9thenmn=16*val(left$(m$,1))
  36. 350 mm=val(right$(m$,1)):m=mn+mm:pokec+1,m
  37. 360 input"what is the second";s$:s=val(s$):ifs<0ors>59then360
  38. 370 sn=0:ifs>9thensn=16*val(left$(s$,1))
  39. 380 ss=val(right$(s$,1)):s=sn+ss:pokec+2,s:pokec+3,0:rem secs, tenths of secs
  40. 390 return
  41.